var Map = JW.Canvas.Component.extend({
	width  : 10000,
	height : 10000,
	
	hero   : null,
	
	render: function()
	{
		this._super();
		
		this.graphics.fillStyle("green");
		this.graphics.beginPath();
		this.graphics.rect(0, 0, this.width, this.height);	
		this.graphics.closePath();
		this.graphics.fill();
		
		this.hero = new Hero({
			x      : 50,
			y      : 200,
			width  : 50,
			height : 50,
			speed  : 5,
			hp     : 100,
			color  : "white",
			
			renderParent : this
		});
	}
});

/*
var map_id = 1;
var map_width = 1000;
var map_height = 500;

function drawMap(){
	//ctx.clearRect(0,0,map_width,map_height);
	
	switch (map_id){
	  case 1:
	    ctx.fillStyle = "green";
	    ctx.beginPath();
	    ctx.rect(0, 0, map_width, map_height);	
	    ctx.closePath();
	    ctx.fill();
		for (var i = 0; i < items.length; i++){
			items[i].draw(ctx);
		}
	    break;
	  case 2:
	    ctx.fillStyle = "grey";
	    ctx.beginPath();
	    ctx.rect(0, 0, map_width, map_height);	
	    ctx.closePath();
	    ctx.fill();
	    break;
	}
}

function Map(id, width, height, barrierObj, npcObj, heroObj, textureObj){
	this._id = id;
	this._width = width;
	this._height = height;
	this.getID = function(){
		return this._id;
	}
	this.getWidth = function(){
		return this._width;
	}
	this.getHeight = function(){
		return this._height;
	}
	this.draw = function(context){
		for (var i = 0; i < npcObj.lenght; i++){
			npcObj[i].draw(context);
		}
		for (var i = 0; i < heroObj.lenght; i++){
			heroObj[i].draw(context);
		}
		for (var i = 0; i < textureObj.lenght; i++){
			textureObj[i].draw(context);
		}
	}
}
*/